import { axios } from '@/utils/request';

const api = {
    // 项目定义
    moralityPage: '/morality/item/page',
    moralityUpdate: '/morality/item/update',
    moralityDelete: '/morality/item/delete',
    moralityCreate: '/morality/item/create',
    moralityAll: '/morality/item/all',
    hasChildGetAll: '/morality/item/getAll',
    // 周期
    cycleAll: '/morality/cycle/all',
    cyclePage: '/morality/cycle/page',
    cycleUpdate: '/morality/cycle/update',
    cycleDelete: '/morality/cycle/delete',
    cycleCreate: '/morality/cycle/create',
    // 方案
    planPage: '/morality/plan/page',
    planCreate: '/morality/plan/create',
    planUpdate: '/morality/plan/update',
    planDelete: '/morality/plan/delete',
    getAll: 'morality/item/getAll', // 创建方案第二步下拉
    // 评语模板
    templatePage: '/morality/comment/template/page',
    templateCreate: '/morality/comment/template/create',
    templateUpdate: '/morality/comment/template/update',
    templateDelete: '/morality/comment/template/delete',
    // 等级
    levelPage: '/morality/level/page',
    levelCreate: '/morality/level/create',
    levelUpdate: '/morality/level/update',
    levelDelete: '/morality/level/delete',
    levelAll: '/morality/level/all',
    getLevel: '/morality/plan/level/get',
    // 党支部分管
    branchPage: '/sys/branch/page',
    branchCreate: '/sys/branch/create',
    branchUpdate: '/sys/branch/update',
    branchDelete: '/sys/branch/delete',
    getBranchDept: '/morality/plan/getBranchDept',
    saveBranchDept: '/morality/plan/saveBranchDept',
    updateBranchDept: '/morality/plan/updateBranchDept',
    deleteBranchDept: '/morality/plan/deleteBranchDept',
    getBranchOfDeptId: '/morality/plan/getBranchOfDeptId',
    // 个人自评
    notePage: '/morality/note/page',
    noteUpdate: '/morality/note/update',
    deptExamineCommit: '/morality/note/deptExamineCommit',
    getDeptNotExamine: '/morality/note/getDeptNotExamine',
    getDeptExamineNur: '/morality/note/getDeptExamineNur',
    getDeptExamineDoc: '/morality/note/getDeptExamineDoc',
    getAppraisalExamine: '/morality/note/getAppraisalExamine', // 考评委员会审核列表
    getPartyBranchExamine: '/morality/note/getPartyBranchExamine', // 党支部审核列表
    deptExamineListCommit: '/morality/note/deptExamineListCommit', // 批量审核列表
}
// hasChildGetAll
export function hasChildGetAll(params) {
    return axios({
        url: api.hasChildGetAll,
        method: 'get',
        params
    });
}

// getBranchOfDeptId
export function getBranchOfDeptId(params) {
    return axios({
        url: api.getBranchOfDeptId,
        method: 'get',
        params
    });
}

// deptExamineListCommit
export function deptExamineListCommit(data) {
    return axios({
        url: api.deptExamineListCommit,
        method: 'put',
        data
    });
}

// updateBranchDept
export function updateBranchDept(data) {
    return axios({
        url: api.updateBranchDept,
        method: 'put',
        data
    });
}

export function deleteBranchDept(id, data = {}) {
    return axios({
        url: `${api.deleteBranchDept}/${id}`,
        method: 'delete',
        data
    });
}

export function getBranchDept(params) {
    return axios({
        url: api.getBranchDept,
        method: 'get',
        params
    });
}

export function saveBranchDept(data) {
    return axios({
        url: api.saveBranchDept,
        method: 'post',
        data
    });
}

// getLevel
export function getLevel(params) {
    return axios({
        url: api.getLevel,
        method: 'get',
        params
    });
}

// deptExamineCommit
export function deptExamineCommit(data) {
    return axios({
        url: api.deptExamineCommit,
        method: 'put',
        data
    });
}

// getPartyBranchExamine
export function getPartyBranchExamine(params) {
    return axios({
        url: api.getPartyBranchExamine,
        method: 'get',
        params
    });
}

// getAppraisalExamine
export function getAppraisalExamine(params) {
    return axios({
        url: api.getAppraisalExamine,
        method: 'get',
        params
    });
}

export function getDeptExamineDoc(params) {
    return axios({
        url: api.getDeptExamineDoc,
        method: 'get',
        params
    });
}

export function getDeptExamineNur(params) {
    return axios({
        url: api.getDeptExamineNur,
        method: 'get',
        params
    });
}

//
export function getDeptNotExamine(params) {
    return axios({
        url: api.getDeptNotExamine,
        method: 'get',
        params
    });
}

// levelAll
export function levelAll(params) {
    return axios({
        url: api.levelAll,
        method: 'get',
        params
    });
}

// getAll
export function getAll(params) {
    return axios({
        url: api.getAll,
        method: 'get',
        params
    });
}

// 个人自评提交
export function noteUpdate(data) {
    return axios({
        url: api.noteUpdate,
        method: 'put',
        data
    });
}

export function notePage(params) {
    return axios({
        url: api.notePage,
        method: 'get',
        params
    });
}

// 党支部
export function branchPage(params) {
    return axios({
        url: api.branchPage,
        method: 'get',
        params
    });
}

export function branchCreate(data) {
    return axios({
        url: api.branchCreate,
        method: 'post',
        data
    });
}

export function branchUpdate(data) {
    return axios({
        url: api.branchUpdate,
        method: 'put',
        data
    });
}

export function branchDelete(id, data) {
    return axios({
        url: `${api.branchDelete}/${id}`,
        method: 'delete',
        data
    });
}

// 考评等级分页
export function levelPage(params) {
    return axios({
        url: api.levelPage,
        method: 'get',
        params
    });
}

export function levelCreate(data) {
    return axios({
        url: api.levelCreate,
        method: 'post',
        data
    });
}

export function levelUpdate(data) {
    return axios({
        url: api.levelUpdate,
        method: 'put',
        data
    });
}

export function levelDelete(id, params) {
    return axios({
        url: `${api.levelDelete}/${id}`,
        method: 'delete',
        params
    });
}

// 评语模板分页
export function templatePage(params) {
    return axios({
        url: api.templatePage,
        method: 'get',
        params
    });
}

export function templateCreate(data) {
    return axios({
        url: api.templateCreate,
        method: 'post',
        data
    });
}

export function templateUpdate(data) {
    return axios({
        url: api.templateUpdate,
        method: 'put',
        data
    });
}

export function templateDelete(id, params) {
    return axios({
        url: `${api.templateDelete}/${id}`,
        method: 'delete',
        params
    });
}

export function planPage(params) {
    return axios({
        url: api.planPage,
        method: 'get',
        params
    });
}

export function planUpdate(data) {
    return axios({
        url: api.planUpdate,
        method: 'put',
        data
    });
}

export function planCreate(data) {
    return axios({
        url: api.planCreate,
        method: 'post',
        data
    });
}

export function planDelete(id, params) {
    return axios({
        url: `${api.planDelete}/${id}`,
        method: 'delete',
        params
    });
}


export function cycleAll(params) {
    return axios({
        url: api.cycleAll,
        method: 'get',
        params
    });
}

export function cyclePage(params) {
    return axios({
        url: api.cyclePage,
        method: 'get',
        params
    });
}

export function cycleCreate(data) {
    return axios({
        url: api.cycleCreate,
        method: 'post',
        data
    });
}

export function cycleUpdate(data) {
    return axios({
        url: api.cycleUpdate,
        method: 'put',
        data
    });
}

export function cycleDelete(id, params) {
    return axios({
        url: `${api.cycleDelete}/${id}`,
        method: 'delete',
        params
    });
}

// 上级项目
export function moralityAll(params) {
    return axios({
        url: api.moralityAll,
        method: 'get',
        params
    });
}

// 项目定义分页
export function moralityPage(params) {
    return axios({
        url: api.moralityPage,
        method: 'get',
        params
    });
}

export function moralityCreate(data) {
    return axios({
        url: api.moralityCreate,
        method: 'post',
        data
    });
}

export function moralityDelete(id, params) {
    return axios({
        url: `${api.moralityDelete}/${id}`,
        method: 'delete',
        params
    });
}

export function moralityUpdate(data) {
    return axios({
        url: api.moralityUpdate,
        method: 'put',
        data
    });
}